import 'dart:ffi';

void main() {
  List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": false},
    {"count": 5, "price": 20.0, "selected": true}
  ];
  var a = 0.0;
  carts.forEach((item) {
    if (item["selected"]) {
      a = a + item["count"] * item["price"];
      return;
    }
  });
  print(a);
}
